﻿#include "RingBuffer.h"
#include "array/Arrays.h"
#include "util/System.h"

using namespace yzrilyzr_util;
using namespace yzrilyzr_array;
namespace yzrilyzr_dsp{
}
#ifdef USEJNI
#include "RingBuffer_JNI.h"
using namespace yzrilyzr_dsp;
JNIEXPORT jlong JNICALL Java_yzrilyzr_dsp_RingBuffer_constructor(JNIEnv *, jobject, jint size){
	RingBuffer * ptr=new RingBuffer(size);
	return reinterpret_cast<jlong>(ptr);
}
JNIEXPORT void JNICALL Java_yzrilyzr_dsp_RingBuffer_destructor(JNIEnv *, jobject, jlong ptr){
	RingBuffer * ptr1=reinterpret_cast<RingBuffer *>(ptr);
	delete ptr1;
}
JNIEXPORT void JNICALL Java_yzrilyzr_dsp_RingBuffer_write(JNIEnv *, jobject, jlong ptr, jdouble value){
	RingBuffer * ptr1=reinterpret_cast<RingBuffer *>(ptr);
	ptr1->write(value);
}
JNIEXPORT void JNICALL Java_yzrilyzr_dsp_RingBuffer_fill(JNIEnv *, jobject, jlong ptr, jdouble value){
	RingBuffer * ptr1=reinterpret_cast<RingBuffer *>(ptr);
	ptr1->fill(value);
}
JNIEXPORT jint JNICALL Java_yzrilyzr_dsp_RingBuffer_capacity(JNIEnv *, jobject, jlong ptr){
	RingBuffer * ptr1=reinterpret_cast<RingBuffer *>(ptr);
	return ptr1->capacity();
}
JNIEXPORT jdouble JNICALL Java_yzrilyzr_dsp_RingBuffer_getFromNewest(JNIEnv *, jobject, jlong ptr, jint index){
	RingBuffer * ptr1=reinterpret_cast<RingBuffer *>(ptr);
	return ptr1->getFromNewest(index);
}
JNIEXPORT jdouble JNICALL Java_yzrilyzr_dsp_RingBuffer_getFromOldest(JNIEnv *, jobject, jlong ptr, jint index){
	RingBuffer * ptr1=reinterpret_cast<RingBuffer *>(ptr);
	return ptr1->getFromOldest(index);
}
JNIEXPORT void JNICALL Java_yzrilyzr_dsp_RingBuffer_reset(JNIEnv *, jobject, jlong ptr){
	RingBuffer * ptr1=reinterpret_cast<RingBuffer *>(ptr);
	ptr1->reset();
}
JNIEXPORT jdouble JNICALL Java_yzrilyzr_dsp_RingBuffer_newest(JNIEnv *, jobject, jlong ptr){
	RingBuffer * ptr1=reinterpret_cast<RingBuffer *>(ptr);
	return ptr1->newest();
}
JNIEXPORT jint JNICALL Java_yzrilyzr_dsp_RingBuffer_mod(JNIEnv *, jobject, jint x, jint m){
	return RingBuffer::mod(x, m);
}
#endif